package com.gitee.feizns.quickstart.web.domain.query;

import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.gitee.feizns.quickstart.domain.query.QueryAo;
import com.gitee.feizns.quickstart.jackson.Val;

import java.util.LinkedHashMap;
import java.util.Map;

/**
 * body查询请求参数
 * @author feizns
 * @since 2025/6/14
 */
public class QueryBodyAo implements QueryAo {

    @Override
    public Map<String, Object> params() {
        return params;
    }

    @Override
    public Val pluck(String key) {
        Val val = param(key);
        params.remove(key);
        return val;
    }

    /**
     * 参数
     */
    @JsonAnyGetter
    @JsonAnySetter
    private final Map<String, Object> params = new LinkedHashMap<>();

}
